﻿using System;
using Obsidian.Edm;
using Obsidian.Utils;
using [#ModelBaseNS#]

/*============================
 * @author [#AUTHOR#]
 * @created [#CREATED#]
 * @desc 分类类型实体
* ============================ */

namespace [#ModelNS#]
{
	/// <summary>
	/// [#TbDescir#] 实体类
	/// </summary>
	public class [#ClsName#]Info : OModel, ITreeNodeInfo
	{
		private string DbcsName = "[#DBAlias#]";	
		private string TableName = "[#TBName#]";

		public [#ClsName#]Info()
		{
			base.InitModel(DbcsName, TableName, new IModelField[] {
				categoryId = new IntField(this, "CategoryId" , "categoryId"),
				parentId = new IntField(this, "ParentId" , "parentId"),
				isParent = new BoolField(this, "IsParent" , "isParent"),
				categoryName = new StringField(this, "CategoryName" , "categoryName"),
				depth = new IntField(this, "Depth" , "depth"),
				path = new StringField(this, "Path" , "path"),
				sortOrder = new IntField(this, "SortOrder" , "sortOrder"),
				created = new DateTimeField(this, "Created" , "created"),
				modified = new DateTimeField(this, "Modified" , "modified"),
				enabled = new BoolField(this, "Enabled" , "enabled")
			});
		}

		#region [字段属性]
		private IntField categoryId;

        /// <summary>
        /// 游戏分类ID
        /// </summary>
        public IntField CategoryId { get { return categoryId; } }

        private IntField parentId;

        /// <summary>
        /// 父级分类ID
        /// </summary>
        public IntField ParentId { get { return parentId; } }

        private BoolField isParent;

        /// <summary>
        /// 是否父级分类
        /// </summary>
        public BoolField IsParent { get { return isParent; } }

        private StringField categoryName;

        /// <summary>
        /// 游戏分类名称
        /// </summary>
        public StringField CategoryName { get { return categoryName; } }

        private IntField depth;

        /// <summary>
        /// 分类层级
        /// </summary>
        public IntField Depth { get { return depth; } }

        private StringField path;

        /// <summary>
        /// 分类路径
        /// </summary>
        public StringField Path { get { return path; } }

        private IntField sortOrder;

        /// <summary>
        /// 排序
        /// </summary>
        public IntField SortOrder { get { return sortOrder; } }

        private DateTimeField created;

        /// <summary>
        /// 创建日期
        /// </summary>
        public DateTimeField Created { get { return created; } }

        private DateTimeField modified;

        /// <summary>
        /// 修改日期
        /// </summary>
        public DateTimeField Modified { get { return modified; } }

        private BoolField enabled;

        /// <summary>
        /// 是否启用
        /// </summary>
        public BoolField Enabled { get { return enabled; } }
		
		#endregion 
		
		#region ITreeNodeInfo 成员
        public LongField NodeId
        {
            get { return categoryId; }
        }

        LongField ITreeNodeInfo.ParentId
        {
            get { return parentId; }
        }

        public StringField NodeName
        {
            get { return categoryName; }
        }
        #endregion
	}
}